using UnityEngine;
using System.Collections;

public class EnemyDieState : State<EnemyControl>
{
    #region Singleton

    private static EnemyDieState instance = new EnemyDieState();
    public static EnemyDieState Instance { get { return instance; } }
    private EnemyDieState() { }

    #endregion

    #region State

    public override void OnEnterState(EnemyControl behaviour)
    {
        behaviour.isTakeDamageEnable = false;
        behaviour.waitTimeEndState = Time.timeSinceLevelLoad + behaviour.waitTimeDie;
    }

    public override void OnUpdateState(EnemyControl behaviour)
    {
        if (behaviour.waitTimeEndState <= Time.timeSinceLevelLoad)
            GameObject.Destroy(behaviour.gameObject);
    }

    public override void OnFixedUpdateState(EnemyControl behaviour)
    {
    }

    public override void OnExitState(EnemyControl behaviour)
    {
    }

    public override void OnCollisionState(EnemyControl behaviour, Collision other)
    {
    }

    public override void OnTriggerState(EnemyControl behaviour, Collider other)
    {
    }

    #endregion
}
